<jsp:include page="/templates/header.jsp"/>

<script type="text/javascript" src="/salonmorandsmigi/js/jquery.form.js"></script>
<script type="text/javascript" src="/salonmorandsmigi/js/jquery.validate.js"></script>
<script type="text/javascript" src="/salonmorandsmigi/js/rparamcheck.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("option").click(function(){
    if (this.id=="admin"){
    	$("#code").show();
    }
    else{
    	$("#code").hide();
    }
  });
});
</script>


<h1>Please Fill the required details</h1>
<br/>
<form action="../UserServlet?action=register" method="GET" id="newUser">
	<p>username:
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		&nbsp;
		<input type="text" name="username" id="username"/>
	</p>
	<p>password:
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		&nbsp;
		<input type="password" name="password" id="password"/>
	</p>
	<p>confirm password:
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		&nbsp;
		<input type="password" name="cpassword" id="cpassword"/>
	</p>
	<p>
		name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;
		<input type="text" name="name" id="name"/>
	</p>
	<p>
		phone number:&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="text" name="phone" id="phone"/>
	</p>
	<p>
		role:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<select name="roles">
			<option id="student" value="student">student</option>
			<option id="admin" value="admin">admin</option>
		</select>
	</p>
	 <div id="code" style="display:none">
	 	<p>admin code:&nbsp;&nbsp;<input type="text" name="code" id="code"/></p>
	 </div>   
	<input type="hidden" name="action" value="register">
	<p class="submit"><input type="submit" value="submit"/></p>
</form>
<jsp:include page="/templates/sidebar.jsp"/>
<jsp:include page="/templates/footer.jsp"/>